function $(s){
	return document.querySelectorAll(s);
}
var index=0;
var imgList=$("#lbt>li"),
icons=$("#icons")[0],
iconList=$("#icons>li");


var timer=setInterval(function(){
	index=index<imgList.length-1?index+1:0;
	play(index);
},3000)
function play(index){
	clearInterval(timer);
	timer=setInterval(function(){
		index=index<imgList.length-1?index+1:0;
		play(index);
	},3000)
	for(var i=0;i<imgList.length;i++){
		imgList[i].className="";
		iconList[i].className="";
	}
	imgList[index].className="curr";
	iconList[index].className="sel";
}
icons.onclick=function(e){
	var ele=e.srcElement;
	if(ele.tagName!="LI"){
		return;
	}
	for(var i=0;i<iconList.length;i++){
		if(iconList[i]==ele){
			index=i;
		}
	}
	play(index);
}




let tabs = document.querySelector(".con-nav")
let content = document.getElementsByClassName('con')
let tablist = tabs.children; 
tabs.onmouseover = function(e){
	let ele = e.srcElement;
	console.log(ele)
	console.log(content)
	// console.log(tablist.index())
	let index; 	
	if(ele.tagName == 'A'){
		for(var i = 0; i<tablist.length;i++){
			tablist[i].className = '';
			content[i].style.display = 'none'
			if(tablist[i]==ele){
				index=i
			}
		}	
		ele.className='connava';
		console.log(content[index])
		content[index].style.display='block';
	}
	

}
